package com.lesama.recursion;

public class RecursionDemo3 {
    public static void main(String[] args) {
        // 猴每天吃当前桃的一半多一个，第x天剩一个桃儿，问首日桃几何
        System.out.println(monkey(1, 12));
    }
    public static int monkey(int day, int x) {
        if(day == x)   return 1;
        return monkey(day + 1, x) * 2;
    }
}